// 公共分页结果
export interface PageResult<T> {
  records: T[]
  current: number
  total: number
  pages: number
  size: number
}

// Demo 示例
export interface DemoItem {
  id: number
  name: string
}

// 接房分页
export interface ReceptionItem {
  id: number | string
  state: number
  houseId: string
  buildingEstateId: string
  buildingBlockId: string
  buildingUnitId: string
  buildingUnitName: string
  buildingBlockName: string
  buildingEstateName: string
  projectId: string
  projectName: string
  houseTypeId: string
  houseTypeName: string
  roomType: string
  orientation: number
  houseNo: string
  bedRoomNum: number
  monthlyRent: number
  sourceType: string
  sourceId: string
  applicationId: string
  applicationName: string
  contractId: string
  contractNo: string
  leaseTermStart: string
  leaseTermEnd: string
  remark: string
  orderId: number
  sort: number
  phone: string
  receiveTime: string
  contractVerification: number
  reasonNonCompliance: string
  facilityVerification: number
  files: string
  userSourceId: string
  houseSituations: Array<{
    id: number
    name: string
    type: number
    remark: string
    state: number
    files: string
  }>
  furnitureSituations: Array<{
    name: string
    type: number
    remark: string
    state: number
    files: string
  }>
}

export interface ReceptionPageParams {
  current: number
  size: number
  state?: number
}

// 退租列表（待退租/已退租）
export interface LeaseListItem {
  id: number | string
  orderId: number
  houseId: string
  houseNo: string
  buildingEstateId: string
  buildingBlockId: string
  buildingUnitId: string
  buildingUnitName: string
  buildingBlockName: string
  buildingEstateName: string
  projectId: string
  projectName: string
  houseTypeId: string
  houseTypeName: string
  applicationId: string
  applicationName: string
  monthlyRents: number
  state: number
  contractId: string
  phone: string
  bankAccount: string
  bankInfo: string
  bankDeposit: number
  idCard: string
  returnReason: string
  applyReturnTime: string
  promiseReturnTime: string
  applyMethod: number
  isOverdue: number
  remark: string
  files: string
  receiveTime: string
  button: Array<{ name: string; type: string }>
  leaseStepList: Array<{
    id: number
    leaseId: number
    content: string
    userSourceId: string
    userName: string
    step: number
    state: number
    rent: number
    houseDeposit: number
    propertyDeposit: number
    rentTotal: number
    approvalTime: string
    remark: string
    files: string
    returnTime: string
    isAllocate: number
    reasonType: string
    reasonAllocate: string
  }>
}

export interface LeaseListParams {
  current: number
  size: number
  keyword?: string
}

// 登录
export interface LoginTokenParams {
  tenantId: string
  refreshToken?: string
  account?: string
  code?: string
  password?: string
}

export interface LoginTokenData {
  accessToken: string
  tokenType: string
  refreshToken: string
  userId: number
  tenantId: string
  oauthId: string
  avatar: string
  authority: string
  userName: string
  account: string
  expiresIn: number
  license: string
}

// 用户详情
export interface UserDetail {
  id: number
  tenantId: string
  code: string
  account: string
  password: string
  name: string
  realName: string
  avatar: string
  email: string
  phone: string
  birthday: string
  sex: number
  roleId: string
  deptId: string
  postId: string
  userType: number
  sourceId: string
  roleName: string
  deptName: string
  postName: string
  sexName: string
}

// OSS 上传返回
export interface BladeFile {
  link: string
  domain: string
  name: string
  originalName: string
}
